package chapter07

import scala.collection.immutable

/**
 * 并行集合
 */
object Test20_Parallel {
  def main(args: Array[String]): Unit = {

    //串行
    val strings: immutable.IndexedSeq[Long] = (1 to 100).map(
      x => Thread.currentThread().getId
    )
    println(strings)

    //并行
    val result2 = (1 to 100).par.map(
      x => Thread.currentThread().getId
    )
    println(result2)


  }
}
